home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / Python / Makefile.in < prev    next >
Makefile  |  1997-08-09  |  3KB  |  101 lines

  1. # Generic Makefile for dynamically linked extension modules.
  2. #
  3. # Jim Fulton, Digital Creations, jim@digicool.com
  4.  
  5.  
  6. # Uncomment and modify these lines if you want to fix the location of
  7. # the PYTHON installation and the python version.  Otherwise, set the
  8. # environment variables before using this Makefile.
  9.  
  10. PYTHONHOME = @PYTHONBASE@
  11. PYTHONVERSION = @PYTHONVER@
  12.  
  13. prefix = @prefix@
  14. exec_prefix = @exec_prefix@
  15. bindir = @bindir@
  16. libdir = @libdir@
  17.  
  18. # The following lines should be left as is:
  19. VERSION=    $(PYTHONVERSION)
  20. pyinstalldir=    $(PYTHONHOME)
  21. installdir=    $(PYTHONHOME)
  22. exec_installdir=$(pyinstalldir)
  23. INCLUDEPY=    $(pyinstalldir)/include/python$(VERSION)
  24. LIBP=        $(exec_installdir)/lib/python$(VERSION)
  25. LIBPL=        $(LIBP)/config
  26. PYMAKE=        make -f $(LIBPL)/Makefile
  27.  
  28. # LIBSO is the location of platform-dependent dynamically linked 
  29. # extension libraries.  This can be handy when you need to build 
  30. # shared libraries that are not extensions but want to store them
  31. # with other extensions and need to know where they are.
  32. # Leave this line as it is.
  33. LIBSO=        `$(PYMAKE) -s echodestshared`
  34.  
  35. # Put your module name here:
  36. MODULE=_pdapilot
  37.  
  38. # Put the object files for your module here:
  39. OBS=$(MODULE).o
  40.  
  41. # Put extra linker options, such as libraries here:
  42. EXTRALD= -L$(libdir) -lpisock
  43.  
  44. # Put Extra compiler options, such as extra -I options, here
  45. CFLAGS=-O -I../include
  46.  
  47. # If you have any Python modules, include them here, so that they
  48. # can get installed.
  49. PYMODULES=pdapilot
  50.  
  51. build:
  52.     if [ "$(MODULE)" != your-module ]; then \
  53.       $(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
  54.         ASHAREDMODULE=$(MODULE) \
  55.         'ASHAREDMODULESOBS=$(OBS)' \
  56.         'ASHAREDMODULESEXTRA=$(EXTRALD)' \
  57.         'OPT=$(CFLAGS)' \
  58.         asharedmodule; \
  59.     fi
  60.  
  61. install: installso installpyc
  62.  
  63. uninstall: uninstallso uninstallpyc
  64.  
  65. installso: build
  66.     if [ "$(MODULE)" != your-module ]; then \
  67.       $(PYMAKE) exec_prefix=$(installdir) \
  68.         ASHAREDMODULE=$(MODULE) asharedinstall; \
  69.     fi
  70.  
  71. installpyc:
  72.     for m in $(PYMODULES) the-end; do \
  73.       if [ "$$m" != the-end ]; then \
  74.         python -c "import $$m"; \
  75.         cp $$m.py $(installdir)/lib/python$(VERSION)/; \
  76.         cp $$m.pyc $(installdir)/lib/python$(VERSION)/; \
  77.       fi; \
  78.     done
  79.  
  80. uninstallpyc:
  81.     for m in $(PYMODULES) the-end; do \
  82.       if [ "$$m" != the-end ]; then \
  83.         rm -f $(installdir)/lib/python$(VERSION)/$$m.py; \
  84.         rm -f $(installdir)/lib/python$(VERSION)/$$m.pyc; \
  85.       fi; \
  86.     done
  87.  
  88.  
  89. uninstallso:
  90.     if [ "$(MODULE)" != your-module ]; then \
  91.         rm -f $(LIBP)/sharedmodules/$(MODULE).so;    \
  92.     fi
  93.  
  94. test:
  95.     python test.py
  96.  
  97. clean::
  98.     -rm -f *.o *.so *.pyc *~ *# so_locations
  99.  
  100. distclean: clean
  101.     rm Makefile